#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>



int main(int argc, char **argv)
{
	//const char path[] = {	"ps", "-o", "pid,ppid,pgrp,session,comm", NULL};
	pid_t pid = fork();
	if (-1 == pid){
		perror("fork()");
		return -1;
	}
	if( 0 == pid){
		//execl("/usr/bin/ps", "ps", "-o", "pid,ppid,pgrp,session,comm", NULL);
		execlp("ps","ps", "-o", "pid,ppid,pgrp,session,comm", NULL);
		perror ("execl()");
		exit(0);
	}else{
		wait(NULL);
	}
	
	return 0;
}
